package cn.com.biz;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.com.dao.ConsumerDao;
import cn.com.entity.Consumer;

public class ConsumerBiz {
	//普通用户biz文件
	

	private ConsumerDao consumerdao;
	
	public ConsumerDao getConsumerdao() {
		return consumerdao;
	}
	public void setConsumerdao(ConsumerDao consumerdao) {
		this.consumerdao = consumerdao;
	}
	//注册增加biz
	public boolean addConsumer(Consumer consumer){
		boolean b=false;
		boolean bool=consumerdao.addConsumer(consumer);
		if(bool){
			b=true;
		}
		return b;
	}
	//用户修改个人资料
	public boolean updateConsumer(Consumer consumer){
		System.out.println("naercuolesssssssssssssssss");
		boolean bool=consumerdao.updateConsumer(consumer);
		System.out.println("到底是那儿错了"+consumer);
		return bool;

	}	
	//验证帐号密码
	public Consumer Consumerlogin(Consumer consumer){
//		ApplicationContext ctx=new ClassPathXmlApplicationContext("applicationContext.xml");
		System.out.println("coconsumerdao：：："+consumerdao);
		Consumer consumerlogin=consumerdao.Consumerlogin(consumer);
		return consumerlogin;
	}
	//biz里面只用写调用dao，如果dao里面没有判断，就在这里面写判断
	
/*	public Consumer ConsumerOne(Consumer consumer){
		System.out.println("dao"+consumer.getConsumername());
		System.out.println("consumerdao"+consumerdao);
		Consumer consumerone=consumerdao.ConsumerOne(consumer);
		
		System.out.println("到底有木有，到底有木有，到底有木有阿ssssssssssssss");
		return consumerone;

	}*/
	
	
	//查询一个用户
	public Consumer selectOneConsumer(Consumer consumer){
		Consumer c=consumerdao.selectOneConsumer(consumer);
		return c;
	}
}
